﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Private_NoPromotion.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="WebHoiChoMuaBan.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	PostNews
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadHolder" runat="server">
    <style type="text/css" media="screen">
			.error { font-weight: Bold; color: Red; }
	</style>
    <script type="text/javascript">
        window.onload = function () {
            CKEDITOR.replace('txtContent',
            {
                filebrowserImageBrowseUrl: '/Upload/Index',
                height: 400,
                ignoreEmptyParagraph: true,
//                htmlEncodeOutput: true,
                language: 'en'
            });
        };

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="hoicho_content_maingroup">
        <!-- Content right -->
        <div class="col_left hoicho_marin_leftright content_right">
            <div class="private_group_friend">
                <%--<%=Html.ValidationSummary("Vui lòng nhập đầy đủ thông tin.", new { @class= "error"})%>
                <form action="<%= Url.Action("Create","News") %>" method="post" enctype="multipart/form-data">
                <table width="100%" border="0">
                        <tr>
                            <td width="12%" valign="middle" align="right" class="private_font_bold">Tiêu đề</td>
                            <td width="88%"><label for="txtTitle"></label>
                                <%= Html.TextBox("txtTitle", (ViewData["News"] == null ? "" : ((News)ViewData["News"]).NewsTitle), new { @class = "input_full" })%>
                            </td>
                        </tr>
                        <tr>
                            <td width="12%" valign="middle" align="right" class="private_font_bold">Tóm tắt</td>
                            <td width="88%"><label for="txtIntro"></label>
                                <%= Html.TextArea("txtIntro", (ViewData["News"] == null ? "" : ((News)ViewData["News"]).NewsIntro ), new { @class = "input_full" })%>
                            </td>
                        </tr>
                        <tr>
                            <td width="12%" valign="middle" align="right" class="private_font_bold">Loại tin</td>
                            <td>
                                <select id="lstNewsType" name="lstNewsType">
                                <%
                                    List<NewsType> lstNewsType = (List<NewsType>)ViewData["ListNewsType"];
                                    if (lstNewsType != null)
                                    {
                                        foreach (var item in lstNewsType)
                                        {
                                            Response.Write("<option value="+item.NewsTypeId+">"+item.NewsTypeName+"</option>");    
                                        }
                                    }
                                    else
                                    {
                                        Response.Write("Không load được dữ liệu");
                                    }
                                %>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td valign="middle" align="right" class="private_font_bold">Hình mình họa</td>
                            <td><label for="newsImg"></label>
                            <input type="file" id="newsImg" name="newsImg"></td>
                        </tr>
                        <tr>
                            <td valign="top" align="right" class="private_font_bold">Nội dung</td>
                            <td>
                                <%= Html.TextArea("txtContent", (ViewData["News"] == null ? "" : ((News)ViewData["News"]).NewsContent), new { @class = "input_full" })%>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td align="center"><input type="submit" class="private_bt_submit_news" value="Đăng tin" style="width:90px;"></td>
                        </tr>
                </table>
                <//form>--%>
            </div>
        </div>
        <!-- End Content right -->
    </div>
</asp:Content>
